package testClass;

public class Test2 {
    public static void main(String[] args) {
        Student student=new Student();

        //通过反射实例化Student的对象
        Class<Student> clazz = Student.class;
        try {
            Student student1 = clazz.newInstance();//等价于new Student();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        System.out.println("获取类的完整名字：" + clazz.getName()); //包名.类名
        System.out.println("获取类的缩写名称:" + clazz.getSimpleName());
    }
}
